import service from '@/utils/request'

// 搜索商品列表
export const getSreachGoods = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/oms-order/oms-sku-list', data)
      .then(res => {
        resolve(res.data)
      })
  })
}

// 结算
export const orderSettle = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/oms-order/oms-order-settle', data)
      .then(res => {
        resolve(res.data)
      })
  })
}
// 提交订单
export const createOrder = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/oms-order/oms-order-add', data)
      .then(res => {
        resolve(res.data)
      })
  })
}

// 提交订单
export const getOrderInfo = (data) => {
  return new Promise((resolve, reject) => {
    service.get('/boss/oms-order/oms-order-get', {params:data})
      .then(res => {
        resolve(res.data)
      })
  })
}


// 关闭
export const closeOrder = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/oms-order/oms-order-close', data)
      .then(res => {
        resolve(res.data)
      })
  })
}

// 收货地址select
export const getAddressList = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/exp-user-address/exp-user-address-list', data)
      .then(res => {
        resolve(res.data)
      })
  })
}


// 计算订单金额
export const computerOrderAmount = (data) => {
  return new Promise((resolve, reject) => {
    service.post('/boss/oms-order/oms-order-computer-amount', data)
      .then(res => {
        resolve(res.data)
      })
  })
}




// 商品详情
export const getSkuInfo = (data) => {
  return new Promise((resolve, reject) => {
    service.get('/boss/pms-spu-info/pms-spu-info-get', {params:data})
      .then(res => {
        resolve(res.data)
      })
  })
}




